import request from "../utils/request"

export default{
    //获取供应商列表
     getList(){
        return request({
            method:"get",
            url:"/supplier/list",
        })
    },
    //分页或条件查询
    search(page,rows,searchMap){
        return request({
            method:"post",
            url:`/supplier/search/${page}/${rows}`,
            data:{
                searchMap,
            }
        })
    },
    //添加供应商
    addSupplier(supplier){
        return request({
            method:"post",
            url:`/supplier/add`,
            data:{
                supplier,
            }
        })
    },
    //获取某个供应商
    getOne(id){
        return request({
            method:"get",
            url:`/supplier/getOne/${id}`,
        })
    },
    //修改某个供应商
    editOne(supplier){
        return request({
            method:"put",
            url:`/supplier/editOne/${supplier.id}`,
            data:{
                supplier,
            }
        })
    },
    //删除某个供应商
    deleteOne(id){
        return request({
            method:"delete",
            url:`/supplier/deleteOne/${id}`,
        })
    }
}